package com.yyk.yykywd.mvvm.ui.fragment

import kotlinx.android.synthetic.main.fragment_business.*
import org.junit.Assert.*
import org.junit.Test

/**
 * 文件描述：
 * Created by guo on 2019-12-18.
 */
class BusinessFragmentTest {
    @Test
    fun testTrans() {
        val answer_money: String? = "10000"
        val s = answer_money ?: "0"
        var unit = ""
        var i = ""
        if (s.toFloat() >= 10000) {
            i = (s.toFloat() / 10000).toString()
            unit = "万元"
        } else {
            i = s.toFloat().toInt().toString()
            unit = "元"
        }
        assertEquals("1", i)
        assertEquals("万元", unit)
    }
}